import R from "@common/type/response";
import { NextApiResponse } from "next";
import { AuthenticatedRequest, withAuth } from '@common/middleware/auth';
import { SysLogininforService } from "@common/service/sys_logininfor";

export async function handler(req: AuthenticatedRequest, res: NextApiResponse) {
    const query = req.query;
    console.log(query);
    const start = parseInt(query._start as string) || 0;
    const end = parseInt(query._end as string) || 10;
    const limit = end - start;
    const offset = start;

    const data = await SysLogininforService.getLogininforList(query, offset, limit);
    R.success(res, data);
}

export default withAuth(handler); 